package org.jivesoftware.smack.filter;

import org.jivesoftware.smack.packet.Packet;

public class ToContainsFilter
  implements PacketFilter
{
  private String to;

  public ToContainsFilter(String paramString)
  {
    if (paramString == null)
      throw new IllegalArgumentException("Parameter cannot be null.");
    this.to = paramString.toLowerCase();
  }

  public boolean accept(Packet paramPacket)
  {
    int i;
    if (paramPacket.getTo() == null)
      i = 0;
    while (true)
    {
      while (true)
      {
        return i;
        if (paramPacket.getTo().toLowerCase().indexOf(this.to) == -1)
          break;
        i = 1;
      }
      i = 0;
    }
  }
}